<template>
  <div>
    {{ $t('h') }}
    <button @click="btn">切换</button>
  </div>
</template>

<script>
export default {
  methods: {
    btn() {
      const _lang = ['zh', 'en']
      const _index = 1 - _lang.indexOf(this.$i18n.locale)
      this.$i18n.locale = _lang[_index]
    }
  }
}
</script>

<style></style>
